// ReportExporter.h: interface for the ReportExporter class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_REPORTEXPORTER_H__BE317108_6393_4210_B5EB_E53AB003BED7__INCLUDED_)
#define AFX_REPORTEXPORTER_H__BE317108_6393_4210_B5EB_E53AB003BED7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\ExcelLib\Excel9.h"

struct ReportAckStruct;
struct ReportTempletHeader;
class ReportField;
struct ExcessStatisticsStruct;
struct DayStatisticsStruct;

class ReportExporter
{
public:
	ReportExporter(ReportAckStruct * pReportAckStruct);
	ReportExporter(ExcessStatisticsStruct * pExcessStatisticsStruct);
	ReportExporter(DayStatisticsStruct * pDayStatisticsStruct);
	virtual ~ReportExporter();

	enum {DontExport, ExcelWorkbookFormat, HtmlFormat};

	ReportTempletHeader * GetpReportTempletHeader() const {ASSERT(m_nReportType == 0);return m_pReportTempletHeader;}
	const std::vector<ReportField *>& GetReportFields() const {ASSERT(m_nReportType == 0);return m_ReportFields;}
	const std::vector<CString>& GetReportItemStrings() const {return m_ReportItemStrings;}

	bool ExportToExcelWorkbook(bool bVisibleExport, int nExportFormat = DontExport, LPCTSTR lpszSaveFileName = NULL);

protected:
	bool ExportCommonReport(bool bVisibleExport, int nExportFormat, LPCTSTR lpszSaveFileName);
	bool ExportExcessStatistics(bool bVisibleExport, int nExportFormat, LPCTSTR lpszSaveFileName);
	bool ExportDayStatistics(bool bVisibleExport, int nExportFormat, LPCTSTR lpszSaveFileName);
	void SetExcelFont(Font& font, const LOGFONT& lf, COLORREF crFont);

protected:
	ReportTempletHeader * m_pReportTempletHeader;
	std::vector<ReportField *> m_ReportFields;
	std::vector<CString> m_ReportItemStrings;

	ExcessStatisticsStruct * m_pExcessStatisticsStruct;

	DayStatisticsStruct * m_pDayStatisticsStruct;

	int m_nReportType;
};

#endif // !defined(AFX_REPORTEXPORTER_H__BE317108_6393_4210_B5EB_E53AB003BED7__INCLUDED_)
